package xyz.jangle.base;
/**
 * 使用Class对象创建实例
 * @author Administrator
 *
 */
public class Example6_8 {

	public static void main(String[] args) {
		
		try {
			Class<?> chinaClass = Class.forName("xyz.jangle.base.China");
			Object object = chinaClass.newInstance();
			China c = (China) object;
			c.getBeijing().speak();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}

	}

}
